//
// Created by 吴锐 on 2022/3/3.
//

#include "iostream"
#include "vector"
#include "algorithm"

using namespace std;

class MyCompare {
public:
    bool operator()(int v1, int v2){
        return v1 > v2;
    }
};

void test01(){
    vector<int> v;

    v.push_back(10);
    v.push_back(20);
    v.push_back(40);
    v.push_back(50);
    v.push_back(30);

    sort(v.begin(), v.end());

    for(vector<int>::iterator it = v.begin() ; it != v.end() ; it++){
        cout << *it << " ";
    }
    cout << endl;

    sort(v.begin(), v.end(), MyCompare());

    cout << "---------------------" << endl;

    for(vector<int>::iterator it = v.begin() ; it != v.end() ; it++){
        cout << *it << " ";
    }
}

int main(){
    test01();
    return 0;
}